package com.ffapp.rainmonitorcustom.bean;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

import my.LogUtil;

public class PatrolCheckListData extends BasisBean {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * XH : 1
	 * PLANNAME : 京华大酒店春节防火安全检查
	 * PLANNO : 00001
	 * CHECKPOINTNO : 000001
	 * CHECKTYPE : 配电室
	 * POSITION : 负一楼配电室
	 * CHECKMAN : 张三
	 * CHECKTIME : 2018-03-08 00:00
	 * OFFCOMNO : sm0001
	 * OFFCOMNAME : 人民剧场
	 * NO : 0000001
	 * PROJECTNO : 350203
	 * RN : 1
	 * IsRecord : true
	 */

	private int XH;
	private String PLANNAME;
	private String PLANNO;
	private String CHECKPOINTNO;
	private String CHECKTYPE;
	private String POSITION;
	private String CHECKMAN;
	private String CHECKTIME;
	private String OFFCOMNO;
	private String OFFCOMNAME;
	private String NO;
	private String PROJECTNO;
	private int RN;
	@JSONField(name = "IsRecord")
	private boolean IsRecord;

	private ArrayList<PatrolCheckListRectifyData> RECTIFY;
	private ArrayList<PatrolCheckListRectifyData> SUPERVISE;
	private ArrayList<PatrolCheckListRectifyData> VERIFY;

	public int getXH() {
		return XH;
	}

	public void setXH(int XH) {
		this.XH = XH;
	}

	public String getPLANNAME() {
		return PLANNAME;
	}

	public void setPLANNAME(String PLANNAME) {
		this.PLANNAME = PLANNAME;
	}

	public String getPLANNO() {
		return PLANNO;
	}

	public void setPLANNO(String PLANNO) {
		this.PLANNO = PLANNO;
	}

	public String getCHECKPOINTNO() {
		return CHECKPOINTNO;
	}

	public void setCHECKPOINTNO(String CHECKPOINTNO) {
		this.CHECKPOINTNO = CHECKPOINTNO;
	}

	public String getCHECKTYPE() {
		return CHECKTYPE;
	}

	public void setCHECKTYPE(String CHECKTYPE) {
		this.CHECKTYPE = CHECKTYPE;
	}

	public String getPOSITION() {
		return POSITION;
	}

	public void setPOSITION(String POSITION) {
		this.POSITION = POSITION;
	}

	public String getCHECKMAN() {
		return CHECKMAN;
	}

	public void setCHECKMAN(String CHECKMAN) {
		this.CHECKMAN = CHECKMAN;
	}

	public String getCHECKTIME() {
		return CHECKTIME;
	}

	public void setCHECKTIME(String CHECKTIME) {
		this.CHECKTIME = CHECKTIME;
	}

	public String getOFFCOMNO() {
		return OFFCOMNO;
	}

	public void setOFFCOMNO(String OFFCOMNO) {
		this.OFFCOMNO = OFFCOMNO;
	}

	public String getOFFCOMNAME() {
		return OFFCOMNAME;
	}

	public void setOFFCOMNAME(String OFFCOMNAME) {
		this.OFFCOMNAME = OFFCOMNAME;
	}

	public String getNO() {
		return NO;
	}

	public void setNO(String NO) {
		this.NO = NO;
	}

	public String getPROJECTNO() {
		return PROJECTNO;
	}

	public void setPROJECTNO(String PROJECTNO) {
		this.PROJECTNO = PROJECTNO;
	}

	public int getRN() {
		return RN;
	}

	public void setRN(int RN) {
		this.RN = RN;
	}

	@JSONField(name = "IsRecord")
	public boolean isRecord() {
		LogUtil.i("isRecord--->"+IsRecord);
		return IsRecord;
	}

	@JSONField(name = "IsRecord")
	public void setRecord(boolean record) {
		IsRecord = record;
	}


	public BaseListDataListBean getDetailList(){
		BaseListDataListBean listBean = new BaseListDataListBean();
		addDataIfnoempty(listBean,"所属单位",OFFCOMNAME);
		addDataIfnoempty(listBean,"检查点编号",CHECKPOINTNO);
		addDataIfnoempty(listBean,"类型",CHECKTYPE);
		addDataIfnoempty(listBean,"位置",POSITION);
		addDataIfnoempty(listBean,"检查人",CHECKMAN);
		addDataIfnoempty(listBean,"检查时间",CHECKTIME);
		addDataIfnoempty(listBean,"整改人",getRectifyMan());
		addDataIfnoempty(listBean,"整改情况",getRectifyStatuss());
		addDataIfnoempty(listBean,"整改时间",getRectifyTime());
		addDataIfnoempty(listBean,"督办人",getSuperviseMan());
		addDataIfnoempty(listBean,"督办意见",getSuperviseStatuss());
		addDataIfnoempty(listBean,"督办时间",getSuperviseTime());
		addDataIfnoempty(listBean,"审核人",getVertifyMan());
		addDataIfnoempty(listBean,"审核意见",getVertifyStatuss());
		addDataIfnoempty(listBean,"审核时间",getVertifyTime());

		return listBean;
	}

	private void addDataIfnoempty(BaseListDataListBean listBean,String name,String value){
//		if(TextUtils.isEmpty(value))return;
		listBean.getList().add(new BaseListData(value,name));
	}

	public String getRectifyTime(){
		if(RECTIFY == null || RECTIFY.size() == 0)return "";
		return  RECTIFY.get(0).getTHETIME();
	}
	public String getRectifyMan(){
		if(RECTIFY == null || RECTIFY.size() == 0)return "";
		return  RECTIFY.get(0).getMAN();
	}
	public String getRectifyStatuss(){
		if(RECTIFY == null || RECTIFY.size() == 0)return "";
		return  RECTIFY.get(0).getINFO();
	}

	public String getVertifyTime(){
		if(VERIFY == null || VERIFY.size() == 0)return "";
		return  VERIFY.get(0).getTHETIME();
	}

	public String getVertifyMan(){
		if(VERIFY == null || VERIFY.size() == 0)return "";
		return  VERIFY.get(0).getMAN();
	}
	public String getVertifyStatuss(){
		if(VERIFY == null || VERIFY.size() == 0)return "";
		return  VERIFY.get(0).getINFO();
	}

	public String getSuperviseTime(){
		if(SUPERVISE == null || SUPERVISE.size() == 0)return "";
		return  SUPERVISE.get(0).getTHETIME();
	}

	public String getSuperviseMan(){
		if(SUPERVISE == null || SUPERVISE.size() == 0)return "";
		return  SUPERVISE.get(0).getMAN();
	}
	public String getSuperviseStatuss(){
		if(SUPERVISE == null || SUPERVISE.size() == 0)return "";
		return  SUPERVISE.get(0).getINFO();
	}




	public ArrayList<PatrolCheckListRectifyData> getRECTIFY() {
		return RECTIFY;
	}

	public void setRECTIFY(ArrayList<PatrolCheckListRectifyData> RECTIFY) {
		this.RECTIFY = RECTIFY;
	}

	public ArrayList<PatrolCheckListRectifyData> getSUPERVISE() {
		return SUPERVISE;
	}

	public void setSUPERVISE(ArrayList<PatrolCheckListRectifyData> SUPERVISE) {
		this.SUPERVISE = SUPERVISE;
	}

	public ArrayList<PatrolCheckListRectifyData> getVERIFY() {
		return VERIFY;
	}

	public void setVERIFY(ArrayList<PatrolCheckListRectifyData> VERIFY) {
		this.VERIFY = VERIFY;
	}

	public  BaseListInfoListBean getListInfoRectify(){
		BaseListInfoListBean listBean = new BaseListInfoListBean();
		ArrayList<PatrolCheckListRectifyData> listOrg = RECTIFY;
		listBean.setTitle("整改情况");
		if(listOrg == null )return listBean;
		for(PatrolCheckListRectifyData data:listOrg){
			BaseListDataListBean dataListBean = new BaseListDataListBean();
			dataListBean.getList().add(new BaseListData(data.getMAN(),"整改人"));
			dataListBean.getList().add(new BaseListData(data.getINFO(),"整改状态"));
			dataListBean.getList().add(new BaseListData(data.getTHETIME(),"整改时间"));
			listBean.getList().add(dataListBean);

		}
		return  listBean;
	}

	public  BaseListInfoListBean getListInfoSupervise(){
		BaseListInfoListBean listBean = new BaseListInfoListBean();
		ArrayList<PatrolCheckListRectifyData> listOrg = SUPERVISE;
		listBean.setTitle("督办意见");
		if(listOrg == null )return listBean;
		for(PatrolCheckListRectifyData data:listOrg){
			BaseListDataListBean dataListBean = new BaseListDataListBean();
			dataListBean.getList().add(new BaseListData(data.getMAN(),"督办人"));
			dataListBean.getList().add(new BaseListData(data.getINFO(),"督办意见"));
			dataListBean.getList().add(new BaseListData(data.getTHETIME(),"督办时间"));
			listBean.getList().add(dataListBean);

		}
		return  listBean;
	}

	public  BaseListInfoListBean getListInfoVertify(){
		BaseListInfoListBean listBean = new BaseListInfoListBean();
		ArrayList<PatrolCheckListRectifyData> listOrg = VERIFY;
		listBean.setTitle("审核意见");
		if(listOrg == null )return listBean;
		for(PatrolCheckListRectifyData data:listOrg){
			BaseListDataListBean dataListBean = new BaseListDataListBean();
			dataListBean.getList().add(new BaseListData(data.getMAN(),"审核人"));
			dataListBean.getList().add(new BaseListData(data.getINFO(),"审核意见"));
			dataListBean.getList().add(new BaseListData(data.getTHETIME(),"审核时间"));
			listBean.getList().add(dataListBean);

		}
		return  listBean;
	}
}
